package 蓝桥.十四届;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author ZhuYi
 * @create 2025/4/8 17:38
 */
public class E蜗牛 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] x = new int[n + 1];
        String[] split = br.readLine().split(" ");
        for (int i = 1; i <= n; i++) {
            x[i] = Integer.parseInt(split[i - 1]);
        }
        double[] a = new double[n + 5];
        double[] b = new double[n + 5];
        for (int i = 1; i < n; i++) {
            String[] split2 = br.readLine().split(" ");
            a[i] = Integer.parseInt(split2[0]);
            b[i + 1] = Integer.parseInt(split2[1]);
        }
        double[][] dp = new double[n + 1][2];
        dp[1][0] = x[1];
        dp[1][1] = x[1] + a[1] / 0.7;
        for (int i = 2; i <= n; i++) {
            dp[i][0] = Math.min(dp[i - 1][0] + x[i] - x[i - 1], dp[i - 1][1] + b[i] / 1.3);
            dp[i][1] = dp[i - 1][0] + x[i] - x[i - 1] + a[i] / 0.7;
            if (a[i] > b[i]) {
                dp[i][1] = Math.min(dp[i][1], dp[i - 1][1] + (a[i] - b[i]) / 0.7);
            } else {
                dp[i][1] = Math.min(dp[i][1], dp[i - 1][1] + (b[i] - a[i]) / 1.3);
            }
        }
        System.out.printf("%.2f", dp[n][0]);
    }
}
